package com.okex.open.api;

import com.alibaba.fastjson.JSONObject;
import com.okex.open.api.bean.trade.param.PlaceOrder;
import com.okex.open.api.config.APIConfiguration;
import com.okex.open.api.service.publicData.PublicDataAPIService;
import com.okex.open.api.service.publicData.impl.PublicDataAPIServiceImpl;
import com.okex.open.api.service.trade.TradeAPIService;
import com.okex.open.api.service.trade.impl.TradeAPIServiceImpl;
import com.okex.open.api.utils.DateUtils;
import com.okex.open.api.utils.DateUtils1;


public class PublicAPITest extends PublicAPIBaseTest {
    private static PublicDataAPIService publicDataAPIService;
    public static String SZBUY = "10";//买入资金量 usdt
    public static String SZSELL = "10";//预期收益 usdt
    public static String symbol = "ACH-USDT";
    private static APIConfiguration config;
    public void before() {
        config = config();
        publicDataAPIService = new PublicDataAPIServiceImpl(config);
    }

    /**
     * 下单 Place Order 卖
     * POST /api/v5/trade/order
     */
    public String getSystemTime(){
        JSONObject result = publicDataAPIService.getSystemTime();
        return JSONObject.parseObject(result.getJSONArray("data").get(0).toString()).getString("ts");
    }
}
